package sysAuth

import initConfig.SysInitData

class SysParams {

    String paramsType
    String paramsDesc
    String value
    String label
    String state
    int orderNum = 0;
    String creator ;//创建人
    String updater ;//更新人
    Date dateCreated;
    Date lastUpdated;
    static constraints = {
        paramsType(nullable: false,blank: false,unique: "value" )
        paramsDesc(nullable: true )
        value(nullable: true  )
        label(nullable: true  )
        state(nullable: true )
        creator(nullable: false )
        updater(nullable: true )
    }
    static mapping = {
        version false
    }

    static init(){
        new SysParams(creator:SysInitData.SYS_ADMIN,paramsType: "USER_SEX",paramsDesc: "性别不可更改",value : "1",label:"男",state:"1",orderNum: 0 ).save(flush: true)
        new SysParams(creator:SysInitData.SYS_ADMIN,paramsType: "USER_SEX",paramsDesc: "性别不可更改",value: "0",label :"女",state:"1",orderNum: 0 ).save(flush: true)
        new SysParams(creator:SysInitData.SYS_ADMIN,paramsType: "USER_SEX",paramsDesc: "性别不可更改", value: "2",label:"其他",state:"1",orderNum: 0 ).save(flush: true)

        new SysParams(creator:SysInitData.SYS_ADMIN,paramsType: "BOOLEAN_FLAG",paramsDesc: "布尔不可更改", value: "1",label:"是",state:"1",orderNum: 0 ).save(flush: true)
        new SysParams(creator:SysInitData.SYS_ADMIN,paramsType: "BOOLEAN_FLAG",paramsDesc: "布尔不可更改", value: "0",label:"否",state:"1",orderNum: 0 ).save(flush: true)

        new SysParams(creator:SysInitData.SYS_ADMIN,paramsType: "EDUCATION",paramsDesc: "学历不可更改", value: "0",label:"本科",state:"1",orderNum: 0 ).save(flush: true)

        new SysParams(creator:SysInitData.SYS_ADMIN,paramsType: "POSITION",paramsDesc: "岗位不可更改", value: "0",label:"高级攻城师",state:"1",orderNum: 0 ).save(flush: true)
    }
}
